<?php $this->load->view('home/layout/header'); ?>
<header class="my-head flex">
	<div class="my-return">
		<a href="<?php echo site_url('home/refund/tourismRefundList'); ?>">
			<i class="iconfont icon-zuojiantou"></i>
		</a>
	</div>
	<div class="my-name">
		退款详情
	</div>
	<div class="my-erwm " data-am-dropdown>
		<a href="javascript:;" class="am-dropdown-toggle" data-am-dropdown-toggle>
			<i class="iconfont">&#xe63a;</i>
		</a>
		<ul class="am-dropdown-content">
            <li><a href="<?php echo site_url(); ?>"><i class="iconfont">&#xe634;</i>首页</a></li>
            <li>
                <a class="sales-share" href="javascript:void(0)">
                    <i class="iconfont">&#xe63c;</i>分享
                </a>
            </li>
        </ul>
	</div>
</header>
<section class="lay-change widthMax">
	<div class="change-head">
		<h4>
			<?php if($refund->status == 2 && $refund->flag == 2): ?>
                <i class="iconfont">&#xe62b;</i>退款成功！
            <?php else : ?>
                <i class="iconfont">&#xe63b;</i>退款申请货成功！等待商家处理中
            <?php endif ?>
		</h4>
		<p>退换金额：<span><?php echo bcsub(bcmul($refund->pay_amount, $refund->number, 2), $refund->counter_fee, 2); ?>元</span></p>
		<p>退换数量：<span><?php echo $refund->number;?></span></p>
	</div>
	<?php if ( $refund->logistics_company && $refund->logistics > 0 ) : ?>
	<a href="<?php echo site_url('home/refund/logistics') , '?company=' , $refund->logistics_company , '&number=' , $refund->logistics; ?>" class="change-logs flex">
		<p class="flex-1">查看退退款物流</p>
		<i class="cash-icon iconfont icon-youjiantou"></i>
	</a>
	<?php endif; ?>
	<div class="change-text">
		<h5>基本信息：</h5>
		<dl>
			<dd>
				<h6>联系人：</h6>
				<div class="flex-1"><?php echo $refund->user_name;?></div>
			</dd>
			<dd>
				<h6>联系电话：</h6>
				<div class="flex-1"><?php echo $refund->cellphone;?></div>
			</dd>
			<dd>
				<h6>退款原因：</h6>
				<div class="flex-1"><?php echo $refund->refund_content;?></div>
			</dd>
			<dd>
				<h6>退款状态：</h6>
				<div class="change-state flex-1">
					<?php if($refund->status == 1 && $refund->flag == 1): ?>
                        退款审核中
                    <?php elseif($refund->status == 2 && $refund->flag == 2): ?>
                        退款成功
                    <?php elseif($refund->status == 3 && $refund->flag == 1): ?>
                        拒绝退款
                    <?php else:?>
                        其它
                    <?php endif ?>
                </div>
			</dd>
			<?php if($refund->status == 3 && $refund->flag == 1 && !empty($refund->reject_content)): ?>
			<dd>
				<h6>拒绝原因：</h6>
				<div class="change-cause flex-1"><?php echo $refund->reject_content;?></div>
			</dd>
			<?php endif ?>
			<?php if ($refund->images) : ?>
			<dd>
				<h6>附件：</h6>
				<div class="change-img flex-1">
					<ul data-am-widget="gallery" class="am-gallery am-avg-sm-2 am-avg-md-3 am-avg-lg-4 am-gallery-imgbordered" data-am-gallery="{pureview: 1}">
					  <li>
					    <div class="am-gallery-item">
					    <img src="<?php echo $this->config->show_image_url($refund->images) ?>">
					  </li>
					</ul>
				</div>
			</dd>
			<?php endif; ?>
			<dd>
				<h6>申请时间：</h6>
				<div class="flex-1"><?php echo $refund->created_at;?></div>
			</dd>
			<?php if ($refund->verify_time > $refund->created_at): ?>
			<dd>
				<h6>审核时间：</h6>
				<div class="flex-1"><?php echo $refund->verify_time;?></div>
			</dd>
			 <?php endif ?>
		</dl>
	</div>
</section>
<?php $this->load->view('home/layout/footer'); ?>